//
//  pushViewController.swift
//  好书
//
//  Created by WZH on 2018/3/27.
//  Copyright © 2018年 WZH. All rights reserved.
//

import UIKit

class pushViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
        setNavigationBar()
    }
    
    func setNavigationBar() {
        let navigationView = UIView(frame: CGRect(x: 0, y: -20, width: SCREEN_WIDTH, height: 65))
        navigationView.backgroundColor = UIColor.white
        self.navigationController?.navigationBar.addSubview(navigationView)
        
        let addBookBtn = UIButton(frame: CGRect(x: 20, y: 20, width: SCREEN_WIDTH, height: 45))
        addBookBtn.setImage(UIImage(named: "plus circle"), for: .normal)
        addBookBtn.setTitle("   新建书评", for: .normal)
        addBookBtn.contentHorizontalAlignment = .left
        addBookBtn.setTitleColor(UIColor.black, for: .normal)
        addBookBtn.titleLabel?.font = UIFont(name: MY_FONT, size: 15)
        addBookBtn.addTarget(self, action: #selector(pushViewController.pushNetBook), for: .touchUpInside)
        navigationView.addSubview(addBookBtn)
        
    }
    
    @objc func pushNetBook() {
        let vc = pushNetBookController();
        GeneralFactory.addTitleWithTitle(target: vc)
        self.present(vc, animated: true, completion: nil)
    }

}
